Garbage collection

ABSTRACT

An example apparatus for garbage collection can include a memory including a plurality of mixed mode blocks. The example apparatus can include a controller. The controller can be configured to write a first portion of sequential host data to the plurality of mixed mode blocks of the memory in a single level cell (SLC) mode. The controller can be configured to write a second portion of sequential host data to the plurality of mixed mode blocks in an XLC mode. The controller can be configured to write the second portion of sequential host data by performing a garbage collection operation. The garbage collection operation can include adding more blocks to a free block pool than a quantity of blocks that are written to in association with writing the second portion of sequential host data to the plurality of mixed mode blocks.

TECHNICAL FIELD

The present disclosure relates generally to semiconductor memory andmethods, and more particularly, to garbage collection.

BACKGROUND

Memory devices are typically provided as internal, semiconductor,integrated circuits and/or external removable devices in computers orother electronic devices. There are many different types of memoryincluding volatile and non-volatile memory. Volatile memory can requirepower to maintain its data and can include random-access memory (RAM),dynamic random access memory (DRAM), and synchronous dynamic randomaccess memory (SDRAM), among others. Non-volatile memory can retainstored data when not powered and can include NAND flash memory, NORflash memory, phase change random access memory (PCRAM), resistiverandom access memory (RRAM), and magnetic random access memory (MRAM),among others.

Memory devices can be combined together to form a solid state drive(SSD). An SSD can include non-volatile memory (e.g., NAND flash memoryand/or NOR flash memory), and/or can include volatile memory (e.g., DRAMand/or SRAM), among various other types of non-volatile and volatilememory. Flash memory devices can include memory cells storing data in acharge storage structure such as a floating gate, for instance, and maybe utilized as non-volatile memory for a wide range of electronicapplications. Flash memory devices typically use a one-transistor memorycell that allows for high memory densities, high reliability, and lowpower consumption.

An SSD can be used to replace hard disk drives as the main storagevolume for a computer, as the solid state drive can have advantages overhard drives in terms of performance, size, weight, ruggedness, operatingtemperature range, and power consumption. For example, SSDs can havesuperior performance when compared to magnetic disk drives due to theirlack of moving parts, which may avoid seek time, latency, and otherelectro-mechanical delays associated with magnetic disk drives.

Some memory cells (e.g., Flash cells, phase change cells, etc.) arecapable of being operated (e.g., programed, read, erased, etc.) in botha single level cell (SLC) mode and an extra level cell (XLC) mode (e.g.,2-bit mode, 3-bit mode, 4-bit mode, etc.). Such cells can be referred toas “mixed mode” memory cells. An SLC memory cell can refer to a cellprogrammed to a targeted one of two different data states and configuredto store a single data unit (e.g., one bit). XLC memory cells can referto cells programmed to a targeted one of more than two different datastates such that they are configured to store more than a single dataunit (e.g., 2 bits, 2.5 bits, 3 bits, 4 bits, etc.). XLC cells may bereferred to as multi state memory cells, multiunit cells, or multilevelcells. XLCs can provide higher density memories without increasing thenumber of memory cells since each cell can represent more than one dataunit.

In various instances, SSDs may be configured to write host data in SLCmode. However, as the available memory space fills up, data written inSLC mode can be rewritten in XLC mode to free up space. A garbagecollection process can be used to select particular blocks for erasureand/or to select the manner in which data written in SLC mode is to be“folded” into XLC blocks. Garbage collection processes can result indata fragmentation. For example, garbage collection can result insequentially written workloads being relocated (e.g., to differentblocks) such that the data is no longer stored sequentially (e.g., suchthat the data is stored in a logically non-sequential manner).

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a diagram of a portion of a memory array having anumber of physical blocks in accordance with a number of embodiments ofthe present disclosure.

FIG. 2 is a block diagram of an apparatus in the form of a computingsystem comprising a memory system in accordance with a number ofembodiments of the present disclosure.

FIG. 3 illustrates a diagram of a controller in accordance with a numberof embodiments of the present disclosure.

FIGS. 4A-4B each illustrate a diagram associated with garbage collectionin accordance with a number of embodiments of the present disclosure.

FIGS. 5A-5F each illustrate a diagram of a memory storing variousportions of data in accordance with a number of embodiments of thepresent disclosure.

FIGS. 6A-6L each illustrate a diagram associated with garbage collectionin accordance with a number of embodiments of the present disclosure.

FIG. 7 illustrates an example flow diagram associated with garbagecollection in accordance with a number of embodiments of the presentdisclosure.

DETAILED DESCRIPTION

An example apparatus for garbage collection can include a memoryincluding a plurality of mixed mode blocks. The example apparatus caninclude a controller. The controller can be configured to write a firstportion of sequential host data to the plurality of mixed mode blocks ofthe memory in a single level cell (SLC) mode. The controller can beconfigured to write a second portion of sequential host data to theplurality of mixed mode blocks in an XLC mode. The controller can beconfigured to write the second portion of sequential host data byperforming a garbage collection operation. The garbage collectionoperation can include adding more blocks to a free block pool than aquantity of blocks that are written to in association with writing thesecond portion of sequential host data to the plurality of mixed modeblocks. The garbage collection operation can free up a greater quantityof blocks than a quantity of blocks that are written to. The firstportion of sequential host data can be an amount of the sequential hostdata. The second portion of sequential host data can be the rest of thesequential host data.

Garbage collection of data stored in memory in accordance with thepresent disclosure can increase the performance (e.g., increase thespeed, increase the reliability, etc.) and/or increase the endurance(e.g., increase the lifetime) of the memory, among other benefits. Forexample, garbage collection schemes in accordance with the presentdisclosure can increase the performance of the memory early in (e.g., atthe beginning of) the lifetime of the memory, when large files, such asoperating system (OS) files, game files, video files, and/or otherprogram installations are likely to be performed on the memory.

Garbage collection can increase write amplification associated withmemory, which can reduce lifetime of an SSD, for example. Writeamplification can refer to a phenomenon in which a quantity of physicaldata written is a multiple of a logical quantity intended to be written.Write amplification can occur due to the fact that flash memory must beerased before being rewritten, often with coarser granularity of theerase operation when compared to the write operation. In variousinstances, larger portions of flash memory may be erased and rewrittenthan actually required by the amount of new data being written. Thismultiplying effect can increase a number of writes over the life of anSSD which can shorten a lifespan of the SSD.

When an SSD is writing large amounts of data sequentially, the writeamplification can be equal to one since the amount of physical datawritten to the drive is the same as the amount of logical data intendedto be written. For instance, if a sequentially written file needs to bedeleted, an entire block(s) can be marked as invalid and there is noneed relocate portions of the block(s) (e.g., via garbage collection).However, in various instances, data fragmentation can be introduced bydynamic single level cell (SLC) caching (e.g., during a first fill ofdata). The data fragmentation can occur as a result of host data, whichis sequential, being written along with garbage collected data, whichmay not be sequential, making the destination block non-sequential. Inorder to make the data sequential again, it can take several logicalfills of data to eliminate the randomness of data in the blocks and makethe data sequential, as described further below in association with FIG.4A. The number of fills used to recover from a fragmentation (which canbe referred to as a recovery rate) can be a strong function offragmentation introduced during a first fill (e.g., such as a first filldescribed in association with FIG. 4A).

In some previous approaches, garbage collection can be initiated when afree block count (e.g., quantity of available blocks) is reduced to aparticular value. In such approaches, garbage collection may be aimed atreleasing a same quantity of free blocks as is being consumed. In anumber of examples described below, garbage collection can be aimed atintentionally creating an imbalance between a block consumption and arelease rate. For example, a number of blocks being released as freeblocks during garbage collection can exceed a number of blocks beingconsumed to cause the garbage collection to be performed.

Garbage collection schemes in accordance with the present disclosure canincrease the performance and/or endurance of the memory as compared withprevious garbage collection approaches. For example, a number ofprevious garbage collection approaches may utilize additional fills ofblocks of memory and additional erases beyond that described in thepresent disclosure in association with a dynamic SLC cache and a forcedSLC cache. As used herein, a “dynamic SLC cache” refers to a cache thatcan be dynamically resized. For example, a size (e.g., number of blocks)of a dynamic SLC cache may be changed during operation (e.g., “on thefly”) to accommodate various demands on the memory. As used herein,“forced SLC caching” refers to caching that includes a requirement thathost data (e.g., data received from a host be written to a memory) bewritten in an SLC mode. As used herein, “forced SLC caching” can referto caching that includes a requirement that host data (e.g., datareceived from a host to be written to a memory) be written in an SLCmode before moving the data to TLC mode.

In contrast to some approaches, embodiments of the present disclosuremay provide for reduced fills of the memory while performing garbagecollection and thereby reducing the number of reads and writes performedon the memory. The embodiments can provide for reduced fills for asteady state sequential workload, i.e. back-to-back sequential writeswithout idle time. In this way, the number of drive fills before garbagecollection can be reduced. For example, a first fill of the data intothe memory, such as writing the data to the memory in a fresh out of thebox (FOB) state in an SLC mode, data can be ordered in a more logicallysequential fashion than previous approaches. Reducing the number offills to order the data logically can reduce reads and writes andincrease long-term performance of the memory.

As used herein, “a number of” something can refer to one or more suchthings. For example, a number of memory cells can refer to one or morememory cells. Additionally, the designators “N”, “B”, “R”, and “S”, asused herein, particularly with respect to reference numerals in thedrawings, indicates that a number of the particular feature sodesignated can be included with a number of embodiments of the presentdisclosure.

The figures herein follow a numbering convention in which the firstdigit or digits correspond to the drawing figure number and theremaining digits identify an element or component in the drawing.Similar elements or components between different figures may beidentified by the use of similar digits. For example, 210 may referenceelement “10” in FIG. 2, and a similar element may be referenced as 310in FIG. 3.

FIG. 1 illustrates a diagram of a portion of a memory array 100 having anumber of physical blocks in accordance with a number of embodiments ofthe present disclosure. Memory array 100 can be, for example, a NANDflash memory array. However, embodiments of the present disclosure arenot limited to a particular type of memory or memory array. For example,memory array 100 can be a DRAM array, an RRAM array, or a PCRAM array,among other types of memory arrays. Further, although not shown in FIG.1, memory array 100 can be located on a particular semiconductor diealong with various peripheral circuitry associated with the operationthereof.

As shown in FIG. 1, memory array 100 has a number of physical blocks116-0 (BLOCK 0), 116-1 (BLOCK 1), . . . , 116-B (BLOCK B) of memorycells. The memory cells can be mixed mode cells operable as SLCs and/orXLCs. The number of physical blocks in memory array 100 may be 128blocks, 512 blocks, or 1,024 blocks, but embodiments are not limited toa particular multiple of 128 or to any particular number of physicalblocks in memory array 100. A first number of blocks 116-0, 116-1, . . ., 116-B can be allocated as a first portion of memory blocks, a secondnumber of blocks 116-0, 116-1, . . . , 116-B can be allocated as asecond portion of memory blocks, and/or a third number of blocks 116-0,116-1, . . . , 116-B can be allocated as a third portion of memoryblocks. Different portions of memory can serve as a dynamic SLC cachefor garbage collection purposes. For example, different portions ofmemory can be dynamically increased and/or decreased in size as demandson the memory are increased and/or decreased and garbage collectionreducing these demands.

A number of physical blocks of memory cells (e.g., blocks 116-0, 116-1,. . . , 116-B) can be included in a plane of memory cells, and a numberof planes of memory cells can be included on a die. For instance, in theexample shown in FIG. 1, each physical block 116-0, 116-1, . . . , 116-Bcan be part of a single die. That is, the portion of memory array 100illustrated in FIG. 1 can be die of memory cells.

As shown in FIG. 1, each physical block 116-0, 116-1, . . . , 116-Bcontains a number of physical rows (e.g., 120-0, 120-1, . . . , 120-R)of memory cells coupled to access lines (e.g., word lines). The numberof rows (e.g., word lines) in each physical block can be 32, butembodiments are not limited to a particular number of rows 120-0, 120-1,. . . , 120-R per physical block. Further, although not shown in FIG. 1,the memory cells can be coupled to sense lines (e.g., data lines and/ordigit lines).

Each row 120-0, 120-1, . . . , 120-R can include a number of pages ofmemory cells (e.g., physical pages). A physical page refers to a unit ofprogramming and/or sensing (e.g., a number of memory cells that areprogrammed and/or sensed together as a functional group). In theembodiment shown in FIG. 1, each row 120-0, 120-1, . . . , 120-Rcomprises one physical page of memory cells. However, embodiments of thepresent disclosure are not so limited. For instance, in a number ofembodiments, each row can comprise multiple physical pages of memorycells (e.g., one or more even pages of memory cells coupled toeven-numbered bit lines, and one or more odd pages of memory cellscoupled to odd numbered bit lines). Additionally, for embodimentsincluding XLCs, a physical page of memory cells can store multiple pages(e.g., logical pages) of data, for example, an upper page of data and alower page of data, with each cell in a physical page storing one ormore bits towards an upper page of data and one or more bits towards alower page of data.

In a number of embodiments of the present disclosure, and as shown inFIG. 1, a page of memory cells can comprise a number of physical sectors122-0, 122-1, . . . , 122-S (e.g., subsets of memory cells). Eachphysical sector 122-0, 122-1, . . . , 122-S of cells can store a numberof logical sectors of data (e.g., data words). Additionally, eachlogical sector of data can correspond to a portion of a particular pageof data. As an example, a first logical sector of data stored in aparticular physical sector can correspond to a logical sectorcorresponding to a first page of data, and a second logical sector ofdata stored in the particular physical sector can correspond to a secondpage of data. Each physical sector 122-0, 122-1, . . . , 122-S, canstore system and/or user data, and/or can include overhead data, such aserror correction code (ECC) data, logical block address (LBA) data, andrecurring error data.

Logical block addressing is a scheme that can be used by a host foridentifying a logical sector of data. For example, each logical sectorcan correspond to a unique logical block address (LBA). Additionally, anLBA may also correspond to a physical address. A logical sector of datacan be a number of bytes of data (e.g., 256 bytes, 512 bytes, or 1,024bytes). However, embodiments are not limited to these examples.

It is noted that other configurations for the physical blocks 116-0,116-1, . . . , 116-B, rows 120-0, 120-1, . . . , 120-R, sectors 122-0,122-1, . . . , 122-S, and pages are possible. For example, rows 120-0,120-1, . . . , 120-R of physical blocks 116-0, 116-1, . . . , 116-B caneach store data corresponding to a single logical sector which caninclude, for example, more or less than 512 bytes of data.

FIG. 2 is a block diagram of an apparatus in the form of a computingsystem 201 comprising a memory system 204 in accordance with a number ofembodiments of the present disclosure. As used herein, a memory system,controller, and/or memory device may separately be an “apparatus”.

Memory system 204 can be, for example, a solid state drive (SSD). In theembodiment illustrated in FIG. 2, memory system 204 includes a hostinterface 206, a memory (e.g., a number of memory devices 210-1, 210-2,. . . , 210-N), and a controller 208 (e.g., an SSD controller) coupledto physical host interface 206 and memory devices 210-1, 210-2, . . . ,210-N.

Memory devices 210-1, 210-2, . . . , 210-N can include, for example, anumber of non-volatile memory arrays (e.g., arrays of non-volatilememory cells). For instance, memory devices 210-1, 210-2, . . . , 210-Ncan include a number of memory arrays analogous to memory array 100previously described in connection with FIG. 1.

In some embodiments, the memory devices 210-1, . . . , 210-N can includea number of arrays of memory cells (e.g., non-volatile memory cells).The arrays can be flash arrays with a NAND architecture, for example.However, embodiments are not limited to a particular type of memoryarray or array architecture. As described above in connection with FIG.1, the memory cells can be grouped, for instance, into a number ofblocks including a number of physical pages of memory cells. In a numberof embodiments, a block refers to a group of memory cells that areerased together as a unit. A number of blocks can be included in a planeof memory cells and an array can include a number of planes. As oneexample, a memory device may be configured to store 8 KB (kilobytes) ofuser data per page, 128 pages of user data per block, 2048 blocks perplane, and 16 planes per device.

In operation, data can be written to and/or read from a memory device ofa memory system (e.g., memory devices 210-1, . . . , 210-N of memorysystem 204) as a page of data, for example. As such, a page of data canbe referred to as a data transfer size of the memory system. Data can betransferred to/from a host 202) in data segments referred to as sectors(e.g., host sectors). As such, a sector of data can be referred to as adata transfer size of the host. In some embodiments, NAND blocks may bereferred to as erase blocks, with blocks being a unit of erasure andpages being a measure of reads and/or writes.

Host interface 206 can be used to communicate information between memorysystem 204 and another device such as a host 202. Host 202 can include amemory access device (e.g., a processor). As used herein, “a processor”can intend a number of processors, such as a parallel processing system,a number of coprocessors, etc. Example hosts can include personal laptopcomputers, desktop computers, digital cameras, digital recording andplayback devices, mobile (e.g., smart) phones, PDAs, memory cardreaders, interface hubs, and the like.

Host interface 206 can be in the form of a standardized physicalinterface. For example, when memory system 204 is used for informationstorage in computing system 201, host interface 206 can be a serialadvanced technology attachment (SATA) physical interface, a peripheralcomponent interconnect express (PCIe) physical interface, or a universalserial bus (USB) physical interface, among other physical connectorsand/or interfaces. In general, however, host interface 206 can providean interface for passing control, address, information (e.g., data), andother signals between memory system 204 and a host (e.g., host 202)having compatible receptors for host interface 206.

Controller 208 can include, for example, control circuitry and/or logic(e.g., hardware and firmware). Controller 208 can be included on thesame physical device (e.g., the same die) as memories 210-1, 210-2, . .. , 210-N. For example, controller 208 can be an application specificintegrated circuit (ASIC) coupled to a printed circuit board includingphysical host interface 206 and memories 210-1, 210-2, . . . , 210-N.Alternatively, controller 208 can be included on a separate physicaldevice that is communicatively coupled to the physical device thatincludes memories 210-1, 210-2, . . . , 210-N. In a number ofembodiments, components of controller 208 can be spread across multiplephysical devices (e.g., some components on the same die as the memory,and some components on a different die, module, or board) as adistributed controller.

Controller 208 can communicate with memory devices 210-1, 210-2, . . . ,210-N to sense (e.g., read), program (e.g., write), and/or eraseinformation, among other operations. Controller 208 can have circuitrythat may be a number of integrated circuits and/or discrete components.In a number of embodiments, the circuitry in controller 208 may includecontrol circuitry for controlling access across memory devices 210-1,210-2, . . . , 210-N and/or circuitry for providing a translation layer(e.g., a flash translation layer) between host 202 and memory system204.

Controller 208 can control operation of a dedicated region, such as ablock addressing portion, of each respective memory device 210-1, 210-2,. . . , 210-N as (e.g., configure a portion of each respective memorydevices 210-1, 210-2, . . . , 210-N to operate as) a static (e.g.,dedicated) single level cell (SLC) cache and/or a dynamic SLC cache. Forexample, a portion of each respective memory device 210-1, 210-2, . . ., 210-N can be configured to operate as a static cache in SLC modeand/or a dynamic cache in SLC mode. This portion of each respectivememory device 210-1, 210-2, . . . , 210-N can be, for example, a firstplurality of blocks (e.g., physical blocks) of memory cells in eachrespective memory, as will be further described herein (e.g., inconnection with FIG. 3), and may be referred to herein as a firstportion of the memory. In addition, portions of each respective memorydevice 210-1, 210-2, . . . , 210-N can include a second plurality ofblocks, a third plurality of blocks, etc.

The second portion of each respective memory 210-1, 210-2, . . . , 210-Ncan be, for example, a second plurality of blocks (e.g., physicalblocks) of memory cells in each respective memory, as will be furtherdescribed herein (e.g., in connection with FIG. 3). Controller 208 canperform erase operations, as well as program and sense operations, onthe cells of the second portion in SLC or XLC mode.

The size of the second portion of each respective memory 210-1, 210-2, .. . , 210-N can correspond to the quantity of memory cells used by thatmemory to program data stored in the SLCs of the memory to the XLCs ofthe memory (e.g., to fold the SLC data to the XLCs). Generally, the sizeof the first portion is small as compared to the whole drive density.

The embodiment illustrated in FIG. 2 can include additional circuitry,logic, and/or components not illustrated so as not to obscureembodiments of the present disclosure. For example, memory device 204can include address circuitry to latch address signals provided over I/Oconnectors through I/O circuitry. Address signals can be received anddecoded by a row decoders and column decoders, to access memories 210-1,210-2, . . . , 210-N.

FIG. 3 illustrates a diagram of a controller 308 in accordance with anumber of embodiments of the present disclosure. The controller may beanalogous to controller 208 illustrated in FIG. 2, and may be coupled toa host interface and/or a plurality of memory devices, as illustrated inFIG. 2, herein. The controller 308 may include a memory managementcomponent 340, which may comprise a wear leveling 342 component, agarbage collection 344 component, a mapping 346 component and an eraseblock tracking 348 component.

In some embodiments, the wear leveling 342 component may be configuredto implement wear leveling on one or more blocks associated with thememory device(s) (e.g., memory device(s) 210-1, . . . , 210-Nillustrated in FIG. 2) to control the wear rate of such memory devices.Wear leveling may reduce the number of process cycles (e.g., programand/or erase cycles) performed on a particular groups of blocks byspreading such cycles more evenly over an entire memory array and/ormemory device. Wear leveling can include static wear leveling and/ordynamic wear leveling to minimize the amount of valid blocks moved toreclaim a block. For example, static wear leveling may include writingstatic data to blocks that have high program/erase counts to prolong thelife of the block. In some embodiments, wear leveling may includegarbage collection operations, which may be implemented by garbagecollection 344 component.

Garbage collection may include reclaiming (e.g., erasing and makingavailable for programming) blocks that have the most invalid pages amongblocks in the memory device(s). In some embodiments, garbage collectionmay include reclaiming blocks with more than a threshold amount (e.g.,quantity) of invalid pages. However, if sufficient free blocks exist fora programming operation, then a garbage collection operation may notoccur. Garbage collection may generally be performed in the background(e.g., during idle time of the memory); however, in some embodiments,garbage collection may be performed in foreground, for instance inresponse to a determination that an amount of free blocks has decreasedbelow a threshold free block count.

In some embodiments, the memory management 340 component may include amapping 346 component that may be configured to control mapping ofmemory blocks in the memory device(s). For example, the mapping 346component may be configured to map bad blocks that discovered duringwear leveling and/or garbage collection operations to blocks that maystill accept valid data.

In some embodiments, the controller 308 may be configured to controlwear leveling utilizing information that may be determined by the eraseblock tracking 348 component. For example, the erase block tracking 348component may be configured to increment a counter associated with eachblock in response to the block being written and/or erased.

FIGS. 4A and 4B illustrate respective diagrams 403 and 405 associatedwith garbage collection. Column 428 includes physical addresses (PAs)corresponding to blocks 432 of memory cells. Column 434-1 indicatesblocks storing “folded” data (e.g., previously written host datarewritten to a block. Column 434-2 indicates blocks storing host datawhich has not been folded. In the example shown in FIGS. 4A and 4B, theblocks are TLC blocks such that each block can store a single data unitin SLC mode or 3 data units in TLC mode. In various embodiments, hostdata is written in SLC mode until the drive reaches a threshold level ofsaturation at which point folding occurs and/or data is written in XLCmode (e.g., TLC mode in this example).

As an example, each PA can correspond to a block on the drive. In thiscase, both the garbage collection and host data can be written to thesame block. In this example, in SLC mode, 1 unit of data may be written.In TLC mode, three (3) units of data may be written. A garbagecollection component of the data can be written to the block,represented by 434-1 and a host component of the data can be written tothe block, represented by 434-2. In response to host data being writtenin SLC mode, one (1) unit of host data can be written to each PA. Inresponse to data being written in TLC mode, three (3) units of data canbe written to each PA. In the diagram 400-1, host data is written in SLCmode in PAs 432-1 to 432-9. Host data is written in TLC mode in PAs432-10 and 432-11. At this point in this example, all the blocks can becompletely used. To write additional host data, garbage collection canbe performed on the blocks. The amount of garbage collection datawritten to the block is represented in column 434-3.

FIG. 4A is associated with garbage collection in accordance withprevious approaches. In some previous approaches, the memory or aportion of the memory can serve as an SLC cache and/or an XLC cache.Memory 400-1 and 400-2 can represent portions of memory arrays such asarray 100 previously described in connection with FIG. 1, for example.

As shown in FIG. 4A, memory 400-1, 400-2 is an example of at least aprevious approach of performing garbage collection. For example, memory400-1 is an illustration of a first fill (e.g., storage) of data. A hostcan store a first data unit “1” in a first block of a column 434-2 ofblocks of memory. The first data unit “1” can be a data unit that isstored first in the memory 400-1. The first data unit “1” can beassociated with a first physical address (“PA”) 432-1 of “1.” The firstdata unit “1” can be stored in an SLC mode and therefore a column 434-1referred to as “Fold” would not be used as there is no data to be folded(included for illustrative purposes to correlate with the descriptionbelow in association with memory 400-2 and shown in memory 400-1 toreiterate that no folding occurs in the initial storing of data from thehost). For clarity, the “FOLD” and “HOST” portions of data in a same PAare in a same block. Further, as an example, a block may have no “fold”data if it is the first sequential fill.

Likewise, a second data unit “2” can be stored by the host in a secondblock, associated with PA 432-2 (e.g., “2”), of the column 434-2 ofblocks of memory. The second data unit “2” can be stored second in orderand subsequent to the first data unit being stored. A third throughninth data unit, “3” through “9,” can be stored in a third through ninthblock (associated with PA 432-3 (e.g., “3”) through PA 432-9 (e.g.,“9”)) of the column 434-2 of blocks of memory in an SLC mode. The thirdthrough ninth data unit can be stored in increasing order from third toninth and subsequent to the first and the second data unit.

In some embodiments, using a dynamic SLC caching method can includeinitially writing host data to blocks of memory that are capable of XLCmode in an SLC mode until free (e.g., empty) blocks are used up. Thiscan provide quicker data access until storing the data in an XLC mode topreserve data storage capacity. For example, when XLC cells are used inan SLC mode, anywhere from ½, ⅓, to ¼ the size of the cell capacity isbeing used (depending on if XLC mode is referring to multi-cell mode (2data values stored in one cell), tri-level cell mode (3 data valuesstored in one cell), or quad-level mode (4 data values stored in onecell)). Hence, the free blocks of memory can be filled if using an SLCmode before the full storage capacity of the blocks of memory has beenreached. Garbage collection can refer to moving host data written in SLCmode to data written in an XLC mode to create additional storagecapacity. If the garbage collection was not performed in order to do so,a write protect mode may be initiated to avoid malfunction.

As data storage capacity of the memory becomes limited, in a dynamic SLCcaching method, additional host data can be initially written in an XLCmode. For example, as illustrated in FIG. 4A, a tenth “10,” eleventh“11,” and twelfth “12” data unit can be stored in a tenth block of thecolumn 434-2 associated with PA 432-10 (e.g., “10”) in an XLC mode. Forexample, the tenth “10” data unit can be an upper page data unit of thetenth block, the eleventh “11” data unit can be a middle page data unitof the tenth block, and the twelfth “12” data unit can be a lower pagedata unit of the tenth block. A thirteenth “13,” fourteenth “14,” andfifteenth “15” data unit can be stored in an eleventh block of thecolumn 434-2 associated with PA 432-11 (e.g., “11”) in an XLC mode. Forexample, the thirteenth “13” data unit can be an upper page data unit ofthe eleventh block, the fourteenth “14” data unit can be a middle pagedata unit of the eleventh block, and the fifteenth “15” data unit can bea lower page data unit of the eleventh block.

While a single data unit is illustrated as shown in each block forpurposes of this example, embodiments are not so limited. Any number ofdata units can be stored in a block of memory and any number of dataunits per fill can be used. For example, data units “1” through “15” arestored initially in memory 400-1 and data units “1” through “30” arestored in memory 400-2 as the host continues to store data units “16”through “30” by garbage collecting. However, embodiments are not limitedto 30 total data units per fill.

As additional host data is written to the blocks of memory, host dataand data already garbage collected can be written together to a block ofmemory. This can create a logically non-sequential storage of data eventhough the host data is being transferred sequentially. Due to datafragmentation introduced by this dynamic SLC caching, several logicalfills can be used to eliminate logical randomness of data. The number offills used to recover from fragmentation can be a function of thefragmentation introduced in the first initial writes. In accordance withembodiments described below, a garbage collection is described thatcreates an imbalance between a number of blocks of memory alreadywritten to and the number of blocks freed up for being written to. Putanother way, more blocks of memory are freed up than are being writtento. In order to accomplish this, the number of blocks filled with hostdata and garbage collected data is reduced.

A garbage collection, illustrated at 436-1, can be performed on datastored in memory 400-1 and results in the data stored as illustrated inmemory 400-2. For example, the first data unit “1” stored in memory400-1 in an SLC mode can be garbage collected and folded, as illustratedby column 434-3, while a sixteenth data unit “16” and a seventeenth dataunit “17” is written by the host to the first block of memory 400-2associated with physical address “1” 432-1. Folding can refer tochanging a data unit from being stored in a SLC mode to being stored ina new location within a cell in XLC mode. The fold column 434-3 is usedto illustrate which data units are folded from a previous locationduring garbage collection. Likewise, the second data unit “2” stored inmemory 400-1 in an SLC mode can be garbage collected and folded togetherwith an eighteenth data unit and a nineteenth data unit to be written asmerged together in an XLC mode in the second block associated with PA432-2 (e.g., “2”), a third data unit “3” can be merged with a twentiethdata unit and a twenty-first data unit, . . . , an eighth data unit canbe merged with a thirtieth data unit and a thirty-first data unit. Thedata units (“9,” “10,” “11,” “12,” “13,” “14,” and “15”) stored inblocks associated with PAs 432-9, 432-10, 432-11 (e.g., “9,” “10,” and“11”) can remain unchanged. The data stored in memory 400-2 after thisgarbage collection can be referred to as a first “fill.”

In this example described in association with FIG. 4A, the data storedin memory 400-2 includes many blocks with “Fold” and “Host” data withina same block. For example, the 1^(st), 2^(nd), 3^(rd), 4^(th), 5^(th),6^(th), 7^(th), and 8^(th) blocks all include fragmented data (and arethe only blocks that experienced garbage collection). This fragmentationcan increase a number of subsequent fills it will take to providesequential data within a same block. By performing a first fill thatresults in more sequential blocks, fewer subsequent fills may be used toprovide a greater number of sequential blocks and achieve a steady statesequential mode of the SSD, as will be described in association withFIG. 4B.

FIG. 4B illustrates a diagram 405 associated with garbage collection inaccordance with a number of embodiments of the present disclosure. Insome embodiments, the memory or a portion of the memory can serve as adynamic SLC cache. Memory 400-1 and 400-3 can be analogous to memorydevices 210-1, 210-2, . . . , 210-N previously described in connectionwith FIG. 2, or may be a portion of memory devices 210-1, 210-2, . . . ,210-N previously described in connection with FIG. 2. In someembodiments, the memory 400-1 and 400-3 can include a number of memoryarrays analogous to memory array 100 previously described in connectionwith FIG. 1.

As shown in FIG. 4B, memory 400-1, 400-3 is an illustration ofperforming a garbage collection. As described in association with FIG.4A above, a first data unit “1” can be stored by the host in a firstblock associated with PA 432-1 of the column 432-2, a second data unit“2” can be stored by the host in a second block associated with PA 432-2(e.g., “2”) of the column 434-2 of blocks of memory. The second dataunit “2” can be stored second in order and subsequent to the first dataunit being stored. A third through ninth data unit, “3” through “9,” canbe stored in a third through ninth block (associated with PA 432-3(e.g., “3”) through PA 432-9 (e.g., “9”)) of the column 434-2 of blocksof memory in an SLC mode. The third through ninth data unit can bestored in increasing order from third to ninth and subsequent to thefirst and the second data unit.

As data storage capacity of the memory becomes limited, in a dynamic SLCcaching method, additional host data can be initially written in an XLCmode. For example, as illustrated in FIG. 4A, a tenth “10,” eleventh“11,” and twelfth “12” data unit can be stored in a tenth block of thecolumn 434-2 associated with PA 432-10 (e.g., “10”) in an XLC mode. Forexample, the tenth “10” data unit can be an upper page data unit of thetenth block, the eleventh “11” data unit can be a middle page data unitof the tenth block, and the twelfth “12” data unit can be a lower pagedata unit of the tenth block. A thirteenth “13,” fourteenth “14,” andfifteenth “15” data unit can be stored in an eleventh block of thecolumn 434-2 associated with PA 432-11 (E.g., “11”) in an XLC mode. Forexample, the thirteenth “13” data unit can be an upper page data unit ofthe eleventh block, the fourteenth “14” data unit can be a middle pagedata unit of the eleventh block, and the fifteenth “15” data unit can bea lower page data unit of the eleventh block.

A garbage collection, illustrated at 436-2, can be performed on datastored in memory 400-1 and results in the data stored as illustrated inmemory 400-3. For example, as the garbage collection, illustrated at436-2, begins, the first data unit “1” and the second data unit “2” canbe garbage collected to free up memory space in the first blockassociated with PA 432-1 (e.g., “1”) in columns 434-5 and 434-6 by beingstored in the first block in an XLC mode. As the sixteenth data unit“16” is sent by the host, the sixteenth data unit “16” can be stored inan XLC mode in the first block with the first data unit “1” and thesecond data unit “2.” As the garbage collection freed up memory space inboth the first block and the second block, associated with PA 432-2(e.g., “2”), the seventeenth “17,” eighteenth “18,” and nineteenth “19”data units are received from the host and can be stored in an XLC modein the second block. This example illustrates a garbage collection thatfrees up more blocks than is being consumed and maintains a greaternumber of sequential blocks while garbage collecting. Data units “1,”“2,” and “16” can be referred to herein as a first portion of sequentialhost data and data units “17,” “18,” and “19” can be referred to hereinas a second portion of sequential host data. Data unit “1” can bereferred to herein as a first set of the first portion and data unit “2”can be referred to herein as a second set of the first portion. As willbe described further below, the first set can refer more generally todata units collected from different blocks (e.g., “1” associated with PA1 432-1 and “2” associated with PA 2 432-2) and the second set can referto data units that are written from the host to a same block as the dataunits of the first set.

In order to receive the twentieth data unit “20” from the host, agarbage collection to free up blocks is performed by folding the thirddata unit “3” and the fourth data unit “4” into the third block in anXLC mode, as illustrated in memory 400-3 at PA 432-3 (e.g., “3”). Thisfrees up an additional data unit to be stored in the third block, asillustrated by the twentieth data unit “20” received from the host beingstored there, and also frees up the fourth block. As the twenty-first“21,” twenty-second “22,” and twenty-third “23” data units are received,they can be stored sequentially in the fourth block. In addition, inorder to receive the twenty-fourth data unit “24,” the 5^(th) and 6^(th)data unit is folded to be stored in the fifth block (associated with PA432-5 (e.g., “5”)) along with the 24^(th) data unit and the subsequentlyreceived 25^(th), 26^(th), and 27^(th) data units are sequentiallystored in the sixth block (associated with PA 432-6 (e.g., “6”)).Further, in order to receive the twenty-eighth data unit “28,” the7^(th) and 8^(th) data units are folded into being stored in the seventhblock in an XLC mode and the subsequently received twenty-ninth “29” andthirtieth “30” data units are sequentially stored in the eighth block(associated with PA 432-8 (e.g., “8”)).

In this way, a full block (the second block) is sequential and includesno non-sequential data units, in contrast to when data units “2,” “18,”and “19” were stored previously in a non-sequential fashion, asillustrated in FIG. 4A. In addition, data units “3,” “4,” and “20” aremerged to be stored in the third block associated with PA 432-3 (e.g.,“3”), data units “21,” “22,” and “23” are merged to be stored in thefourth block associated with PA 432-4 (e.g., “4”), and so forth down todata units “29” and “30” being stored in a eighth block associated withPA 432-8 (e.g., “8”). Data units “9” through “15” remained stored inblocks nine through eleven associated with PA 432-9 (e.g., “9”) to PA432-11 (e.g., “11”). In this way, the second, fourth, sixth, eighth,tenth, and eleventh blocks store sequential data.

FIGS. 5A-5C each illustrate a diagram of a memory storing variousportions of data in accordance with a number of embodiments of thepresent disclosure. FIG. 5A illustrates a memory including seven blocksof memory 560-0 to 560-6 that are referred to as a dynamic SLC cache.However, this example is not limited to seven blocks of memory. Eachblock of memory, as illustrated, includes three memory cells,illustrated as 563-1, 563-2, and 563-3. Each memory cell can store up tothree data units (e.g., bits of data) in an XLC mode, illustrated asdata position 562-0 associated with an upper page bit, data position562-1 associated with a middle page bit, and data position 562-2associated with a lower page bit for a first memory cell 563-1 of the0^(th) block 560-0. Data position 562-3 is associated with an upper pagebit, data position 562-4 is associated with a middle page data bit, anddata position 562 -5 is associated with a lower page bit of a secondmemory cell 563-2 of the 0^(th) block 560-0. Data position 562-6 isassociated with an upper page bit, data position 562-7 is associatedwith a middle page bit, and data position 562-8 is associated with alower page bit of a third memory cell 563-3 of the 0^(th) block 560-0.Data units can be logically sequential when stored in the 0^(th) block560-0. For example, data unit “1” is stored in a left-most position(most significant bit (MSB) position) 562-0, data unit “2” is stored ina second MSB position 562-1, data unit “3” is stored in a third MSBposition 562-2, and so forth to data unit “9” being stored in a leastsignificant bit (LSB) position 562-8 to fill the 0^(th) block 560-0.

In a similar fashion, data units “10 to “18” can be stored logicallysequential in a 1^(st) block 560-1 in three cells 563-1 (associated withdata positions 562-0 to 562-2), 563-2 (associated with data positions562-3 to 562-4), and 563-3 (associated with data positions 562-6 to562-8). Data units “19” to “27” can be stored logically sequential in a2^(nd) block 560-2, data units “28” to “36” can be stored logicallysequential in a 3^(rd) block 560-3, and data units “37” to “42” can bestored logically sequential in a 4^(th) block 560-4. A 5^(th) block560-5 and a 6^(th) block 560-6 can be free (e.g., empty) and availablefor storing additional data units.

FIG. 5B illustrates a memory including seven blocks of memory 560-0 to560-6. FIG. 5B is an example of a first fill of data sent from a host tothe memory that includes erasing previous data. For example, data units“1” through “3” are written to a third memory cell 563-3 of a 4^(th)block 560-4. Data units “4” through “12” are written to a third memorycell 563-3 of a 5^(th) block 560-5. As data units “1” through “12” werepreviously written to the 0^(th) block 560-0 and the 1^(st) block 560-1,those data units are overwritten (indicated as a strikethrough in FIG.5B) and are now free to be written to.

FIG. 5C illustrates a memory including seven blocks of memory 560-0 to560-6. FIG. 5C is an example of host data writing data units “13” to“21” to the 6^(th) block 560-6. As data units “13” to “21” are written,data units “13” to “21” that were previously written to the 1^(st) block560-1 and the 2^(nd) block 560-2 are now invalid and can be overwritten(as indicated by strikethrough).

FIG. 5D illustrates a memory including seven blocks of memory 560-0 to560-6. FIG. 5D is an example of host data writing data units “22” to“30” to the 0^(th) block 560-0. As data units “22” to “30” are written,the data units “22” to “30” previously written to the 2^(nd) block 560-2and the 3^(rd) block 560-3 are now invalid and can be overwritten (asindicated by strikethrough).

FIG. 5E illustrates a memory including seven blocks of memory 560-0 to560-6. FIG. 5E is an example of host data writing data units “31” to“39” to the 1^(st) block 560-1. As data units “31” to “39” are written,the previously written data units “13” to “21” in the 1^(st) block 560-1and the 2^(nd) block 560-2 are now invalid and can be overwritten (asindicated by strikethrough).

FIG. 5F illustrates a memory including seven blocks of memory 560-0 to560-6. FIG. 5F is an example of host data writing data units “40” to“42” to the 2^(nd) block 560-2. As data units “40” to “42” are written,the previously written data units “40” to “42” to the 4^(th) block 560-4can be overwritten (as indicated by strikethrough). In this way, as hostdata is written to the memory blocks, a free memory block precedes itand garbage collection is not necessary when writing in XLC mode.However, in some embodiments, a host can be limited to initially writingin SLC mode, which makes can make it more difficult to maintain enoughblock space while avoiding garbage collection.

FIGS. 6A-6I each illustrate a diagram of a memory storing variousportions of data in accordance with a number of embodiments of thepresent disclosure. FIGS. 6A-6I are an example of a forced SLC modecache. For example, data sent from the host to the blocks of memory areinitially stored in an SLC mode. In order to free up additional memoryspace, the data stored in SLC mode can be garbage collected into an XLCmode subsequent to the initial storing by the host. In some embodiments,firmware can choose a block with the least amount of valid data andrelocate them to an XLC block to free up memory. Data written in an SLCmode by a host can be garbage collected to be stored in an XLC mode.Data written in an XLC mode can also be garbage collected to order thedata in a logically sequential fashion or to reorganize the data to bemore efficient.

Example embodiments in accordance with the present disclosure include anoptimized garbage collection method. This is accomplished by sorting theblocks based on an amount of valid data and a block version, such as anSLC block or an XLC block. A block of memory can be chosen to be garbagecollected by choosing a block for garbage collection in response to ablock with the least valid data (e.g., a least valid block (LV Block), amost invalid block (MV Block), a bottom block) being in SLC mode. Inresponse to the least valid block being in an XLC mode, check a nextblock in a list of blocks. For example, a least valid block can refer toa block with a larger amount of invalid data. A next block can be a nextleast valid block with a next-largest amount of invalid data. Inresponse to the next least valid block being in an XLC mode as well,choose the least valid block. In response to the next least valid blockbeing in an SLC mode, choose the next least valid block. In this way, anefficient method of choosing blocks for garbage collection can beperformed.

FIG. 6A illustrate a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. FIG. 6A is an example of data units (e.g., bits of data) “1”through “18” being stored in an SLC mode in seven blocks of memory 664-0to 664-6. For example, data units “1” through “3” are stored in a 0^(th)block 664-0, data units “4” through “6” are stored in a 1^(st) block664-0, data units “7” through “9” are stored in a 2^(nd) block 664-2,data units “10” through “12” are stored in a 3^(rd) block 664-3, dataunits “13” through “15” are stored in a 4^(th) block 664-4, data units“16” through “18” are stored in a 5^(th) block 664-5, and a 6^(th) block664-6 is free and ready to be written to. However, in order to write toan additional block, in some examples, a memory system (such as memorysystem 204) may require that at least one block be empty and able to bewritten to in order to write to an additional block. For example, inFIG. 6A, an additional block of memory would need to be writeable, inaddition to the 6^(th) block 664-6, in order to write to the 6^(th)block 664-6.

FIG. 6B illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. FIG. 6B is an example of a first garbage collection beingperformed in order to free up additional blocks to be written to by thehost. As the garbage collection is performed, data stored in an SLC modecan be transferred to being data stored in an XLC mode. As illustratedin FIG. 6B, data units “1” through “9” are garbage collected from beingstored in a 0^(th) 664-0 through 2^(nd) block 664-2 in an SLC mode tobeing stored in a 6^(th) block 664-6 in an XLC mode.

For illustrative purposes, for all of FIGS. 6A to 6J, blocks of memorywith three squares are illustrating three memory cells that are in anSLC mode, such as in FIG. 6B where memory cells in columns 666-0 to666-2 are in the 0^(th) block 664-0 and are in an SLC mode. Asillustrated in FIG. 6B, blocks of memory with nine squares areillustrating three memory cells in an XLC mode that each include threedata units (an upper page, a middle page, and a lower page), such as, inFIG. 6B, the 6^(th) block 664-6 including an upper page data unitassociated with data unit position 666-0, a middle page data unitassociated with data unit position 666-1, and a lower page data unitassociated with data unit position 666-2 of a first memory cell.Further, data unit positions 666-3 to 666-5 are associated with a secondmemory cell and data unit positions 666-6 to 666-8 are associated with athird memory cell. As data units “1” through “9” are garbage collectedto be stored in the 6^(th) block 664-6, the previously stored data units“1” through “9” in the 0^(th) through 2^(nd) blocks 664-0 to 664-2 canbe indicated as invalid and overwritten (illustrated as being instrikethrough).

FIG. 6C illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. FIG. 6C is an example of additional data units “19” through“24” being written to the 0^(th) block 664-0 and the 1^(st) block 664-1.As this leaves only the 2^(nd) block 664-2 as an empty block to bewritten to, a second garbage collection can be performed to free upadditional blocks to be written to by the host. As the garbagecollection is performed, data units “10” through “18” stored in an SLCmode in the 3^(rd) block 664-3 through the 5^(th) block 664-5 can betransferred to being data stored in an XLC mode in the 2^(nd) block664-2. The previously stored data units “10” through “18” can beindicated as invalid and overwritten (indicated by a strikethrough).

FIG. 6D illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. FIG. 6D is an example of additional data units “25” through“30” being written by the host to the 3^(rd) block 664-3 and the 4^(th)block 664-4 in an SLC mode. As this leaves only the 5^(th) block 664-5as an empty block to be written to, a third garbage collection can beperformed to free up additional blocks to be written to by the host. Asthe garbage collection is performed, data units “19” through “27”(including recently written data units 25″ through “27”) that are storedin an SLC mode in the 0^(th) block 664-0, the 1^(st) block 664-1, andthe 3^(rd) block 664-3 can be transferred to being data stored in an XLCmode in the 5^(th) block 664-5. The previously stored data units “19”through “27” can be indicated as invalid and overwritten (indicated by astrikethrough).

FIG. 6E illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. FIG. 6E is an example of additional data units “31” through“36” being written by the host to the 0^(th) block 664-0 and the 1^(st)block 664-1 in an SLC mode. As this leaves only the 3^(rd) block 664-3as an empty block to be written to, a fourth garbage collection can beperformed to free up additional blocks to be written to by the host.FIG. 6F illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. FIG. 6F is an example of the fourth garbage collection beingperformed on data units “28” through “36” (including recently writtendata units “31” through “36”) that are stored in an SLC mode in the4^(th) block 664-4, the 0^(th) block 664-0, and the 1^(st) block 664-1can be transferred to being data stored in an XLC mode in the 3^(rd)block 664-3. The previously stored data units “28” through “36” can beindicated as invalid and overwritten (indicated by a strikethrough).

FIG. 6G illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. FIG. 6G is an example of additional data units “37” through“42” being written by the host to the 4^(th) block 664-4 and the 0^(th)block 664-0, respectively, in an SLC mode. This leaves only the 1^(st)block 664-1 as an empty block to be written to. FIG. 6H illustrates adiagram of a memory storing various portions of data in accordance witha number of embodiments of the present disclosure. FIG. 6H is an exampleof a fifth garbage collection that can be performed to free upadditional blocks (e.g., the 0^(th) and 4^(th) blocks 664-0 and 664-4)to be written to by the host. As the garbage collection is performed,data units “37” through “42” that are stored in an SLC mode in the4^(th) block 664-4 and the 0^(th) block 664-0 can be transferred tobeing data stored in an XLC mode in the 1^(st) block 664-1. The dataunits “37” through “42” previously stored in the 4^(th) and 0^(th)blocks 664-0 and 664-4 can be indicated as invalid and overwritten(indicated by a strikethrough).

FIG. 6I illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. FIG. 6I is an example of additional data units “42” through“45” being written by the host to the 4^(th) block 664-4 in an SLC mode.At the conclusion of the sixth garbage collection, all 45 data unitssent by the host to be stored in the blocks of memory have been storedin the seven blocks of memory without sending the memory system into awrite-protect mode. As this leaves only the 0^(th) block 664-0 as anempty block to be written to, a sixth garbage collection can beperformed to free up additional blocks to be written to by the host, asdescribed in association with FIG. 6J.

FIG. 6J illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. As shown in FIG. 6J, a sixth garbage collection includestransferring data units “43” through “45” that are stored in an SLC modein the 4^(th) block 664-4 to be stored in an XLC mode in the 1^(st)block 664-1 in association with columns 666-6, 666-7, and 666-8. Thepreviously stored data units “43” through “45” can be indicated asinvalid and overwritten (indicated by a strikethrough). Further, asillustrated in FIG. 6J, subsequent to the sixth garbage collection,newly written data units “1,” “2,” and “3” can be written in an SLC modeto the 0^(th) block 664-0. As this leaves only the 0^(th) block 664-0 asan empty block to be written to, a sixth garbage collection can beperformed to free up additional blocks to be written to by the host, asdescribed in association with FIG. 6K.

FIG. 6K illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. As shown in FIG. 6K, a seventh garbage collection includestransferring data units “1” through “3” that are stored in an SLC modein the 0^(th) block 664-0 to be stored in an SLC mode in the 4^(th)block 664-4. The previously stored data units “1” through “3” can beindicated as invalid and overwritten (indicated by a strikethrough inthe 0^(th) block 664-0).

FIG. 6L illustrates a diagram of a memory storing various portions ofdata in accordance with a number of embodiments of the presentdisclosure. As shown in FIG. 6L, newly written data units “4” through“6” are written to the 0^(th) block 664-0. The previously written dataunits “4” through “6” in the 6^(th) block 664-6 are now invalid andoverwritten (as indicated by the strikethrough). As this leaves no emptyblocks and a partially invalid 6^(th) block 664-6, a garbage collectionmay be performed. However, whether to garbage collect the 0^(th) block664-0 or the 6^(th) block 664-6 is determined. As the 6^(th) block 664-6is older data, some previous approaches may choose the 6^(th) block664-6 to garbage collect. These previous approaches may result ingarbage collecting data that was already recently garbage collected. Forsequential data patterns, garbage collecting this recently garbagecollected data may decrease system performance. This can be due to hostdata being garbage collected to an XLC block that is then automaticallyoverwritten but garbage collected just before it would have beenoverwritten. For example, garbage collecting FOLD data stored in an XLCblock that may be subsequently garbage collected again in the nearfuture may decrease system performance. This may be avoided by choosinga source block for garbage collection that is an SLC block rather thanan XLC block where possible to decrease the likelihood that it will begarbage collected again in the near future.

To accomplish choosing an SLC block over an XLC block for garbagecollection when possible, in accordance with the description herein, adetermination can be made based on whether a least valid (“LV”) block(in this example the 6^(th) block 664-6) is in an SLC mode or a TLCmode. If the LV block is in an SLC mode, the least valid block isgarbage collected. However, if the LV block (664-6) is in a TLC mode, adetermination of whether a next LV block (in this example, 0^(th) block664-0) is in SLC mode or TLC mode is performed. Since the LV block(664-6) is in TLC mode and the next LV block (664-0) is in SLC mode, thenext LV block (664-0) is chosen for garbage collection. FIG. 7illustrates an example flow diagram 707 for memory management inaccordance with a number of embodiments of the present disclosure. Theflow diagram 707 can include, at 790, sorting blocks of memory by anamount of valid data within the blocks. For example, as data is writtenfrom the host to the blocks of memory, an amount of invalid (e.g.,redundant) data can be indicated for each of a plurality of mixed modeblocks of memory. A block filled with more redundant (and therefore moreinvalid) data can be sorted in contrast to a block with less redundant(and therefore less invalid, and more valid) data.

At 791, a next block can be chosen for garbage collection based on adetermination of a mode of the next block (e.g., an SLC mode or a XLCmode). A next block can refer to a block with a next-most quantity ofinvalid data. At 792, a determination of whether the least valid (“LV”)block is in an SLC mode can be performed. In response to the least validblock being in an SLC mode, the least valid block is chosen as the nextblock to be garbage collected. At 793, a determination of whether theleast valid block is in a XLC mode can be performed. In response to theleast valid block being in a XLC mode, a next least valid (“LV”) blockis checked. At 794, in response to the next least valid block being in aXLC mode, the least valid block is chosen for garbage collection. At795, in response to the next least valid block being in an SLC mode, thenext least valid block is chosen for garbage collection. In this way, ablock of memory can be chosen for garbage collection that mostefficiently provides for additional memory space without slowing downprocessing resources and with fewer resource usage.

Although specific embodiments have been illustrated and describedherein, those of ordinary skill in the art will appreciate that anarrangement calculated to achieve the same results can be substitutedfor the specific embodiments shown. This disclosure is intended to coveradaptations or variations of a number of embodiments of the presentdisclosure. It is to be understood that the above description has beenmade in an illustrative fashion, and not a restrictive one. Combinationof the above embodiments, and other embodiments not specificallydescribed herein will be apparent to those of ordinary skill in the artupon reviewing the above description. The scope of a number ofembodiments of the present disclosure includes other applications inwhich the above structures and methods are used. Therefore, the scope ofa number of embodiments of the present disclosure should be determinedwith reference to the appended claims, along with the full range ofequivalents to which such claims are entitled.

In the foregoing Detailed Description, some features are groupedtogether in a single embodiment for the purpose of streamlining thedisclosure. This method of disclosure is not to be interpreted asreflecting an intention that the disclosed embodiments of the presentdisclosure have to use more features than are expressly recited in eachclaim. Rather, as the following claims reflect, inventive subject matterlies in less than all features of a single disclosed embodiment. Thus,the following claims are hereby incorporated into the DetailedDescription, with each claim standing on its own as a separateembodiment.

What is claimed is:
 1. An apparatus, comprising: a memory comprising aplurality of mixed mode blocks; a controller configured to: responsiveto receiving an amount of data to be written to the memory, perform aforeground garbage collection operation that includes: determining ablock of the plurality of mixed mode blocks storing single level cell(SLC) mode data to be converted to multi level cell (MLC) mode data;folding data stored in a first block of the plurality of mixed modeblocks in SLC mode and data stored in a second block of the plurality ofmixed mode blocks in SLC mode, wherein folding the data of the firstblock and the data of the second block results in the data of the firstblock and the data of the second block being stored in the first block;and storing a first portion of sequential host data received from a hostin the first block in MLC mode; and storing a second portion ofsequential host data received from the host in a third block of theplurality of mixed mode blocks such that the third block does notinclude folded data; wherein performing the foreground garbagecollection operation includes adding more blocks to a free block poolthan a quantity of blocks that are written to in association withwriting the first portion of sequential host data to the plurality ofmixed mode blocks.
 2. The apparatus of claim 1, wherein the controllerconfigured to perform the garbage collection operation comprises thecontroller configured to perform a garbage collection operation thatresults in at least half of the plurality of mixed mode blocks beinglogically sequential.
 3. The apparatus of claim 1, wherein thecontroller is configured to garbage collect the first portion ofsequential host data by garbage collecting a first set of data stored inthe first block of the plurality of mixed mode blocks and a second setof data stored in the second block of the plurality of mixed mode blocksand writing the first set and the second set to the first block.
 4. Theapparatus of claim 3, wherein the first set of data and the second setof data are logically sequential in relation to each other.
 5. Theapparatus of claim 3, wherein the controller is further configured towrite a third set of host data to the first block, wherein the firstblock stores the first set, the second set, and the third set.
 6. Theapparatus of claim 5, wherein the third set is not logically sequentialin relation to the first set and the second set.
 7. The apparatus ofclaim 6, wherein the first block storing the first set, the second set,and the third set is a logically fragmented block.
 8. The apparatus ofclaim 5, wherein the controller is further configured to write a fourthset of host data to the second block.
 9. The apparatus of claim 8,wherein the second block storing the fourth set is logically sequential.10. The apparatus of claim 8, wherein the fourth set comprises threedata units and wherein the three data units are logically sequential inrelation to each other.
 11. A method, comprising: responsive toreceiving an amount of data to be written to a plurality of mixed modeblocks of a memory, performing a foreground garbage collection operationthat includes: determining a block of the plurality of mixed mode blocksstoring single level cell (SLC) mode data to be converted to multi levelcell (MLC) mode data; folding data stored in a first block of theplurality of mixed mode blocks in SLC mode and data stored in a secondblock of the plurality of mixed mode blocks in SLC mode, wherein foldingthe data of the first block and the data of the second block results inthe data of the first block and the data of the second block beingstored in the first block; and storing a first portion of sequentialhost data received from a host in the first block in MLC mode; andstoring a second portion of sequential host data received from the hostin a third block of the plurality of mixed mode blocks such that thethird block does not include folded data.
 12. The method of claim 11,comprising writing a third portion of host data in an XLC mode to ablock that previously stored one of the at least two data units of thefirst portion.
 13. The method of claim 11, wherein the at least two dataunits of the first portion are each stored in a different block ofmemory.
 14. The method of claim 11, wherein writing the second portionof data comprises, in response to a threshold number of blocks beingempty, garbage collecting the first block and the second block stored inan SLC mode to be stored in the first block in an XLC mode.
 15. Themethod of claim 14, wherein writing the second portion of data compriseswriting host data to the second block, wherein the garbage collectionoperation was triggered in response to the host data being sent whenthere was the threshold number of empty blocks.
 16. An apparatus,comprising: a memory comprising a plurality of mixed mode blocks; acontroller configured to: write sequential host data received from ahost to a first block of the plurality of mixed mode blocks of thememory in a single level cell (SLC) mode; and responsive to receiving anamount of data to be written to the memory, perform a foreground garbagecollection operation that includes: determining to convert the firstblock from SLC mode data to MLC mode data; folding the sequential hostdata stored in the first block in SLC mode and data stored in a secondblock of the plurality of mixed mode blocks in SLC mode, wherein foldingthe data of the first block and the data of the second block results inthe data of the first block and the data of the second block beingstored in the first block; and storing a first portion of sequentialhost data received from a host in the first block in MLC mode; andstoring a second portion of sequential host data received from the hostin a third block of the plurality of mixed mode blocks such that thethird block does not include folded data.
 17. The apparatus of claim 16,wherein the controller is configured to determine the garbage collectionoperation should be performed on the portion of data based on adetermination of an amount of valid data in each of the plurality ofmixed mode blocks.
 18. The apparatus of claim 16, wherein the controlleris configured to determine which set of data of the sequential host datato perform the garbage collection operation based on a determination ofwhether a particular block is an SLC mode block.
 19. The apparatus ofclaim 18, wherein the controller is configured to determine which blockis the particular block based on whether the particular block includesan amount of valid data.
 20. The apparatus of claim 18, wherein thecontroller is configured to, in response to a determination that theparticular block is an XLC mode block, determine whether a next leastvalid block with a next most amount of invalid data is an XLC modeblock.
 21. The apparatus of claim 20, wherein the controller isconfigured to, in response to determining that the next least validblock is an XLC mode block, choose the particular block to perform thegarbage collection on.
 22. The apparatus of claim 20, wherein thecontroller is configured to, in response to determining that the nextleast valid block is an SLC mode block, choose the next least valid toperform the garbage collection on.
 23. A method, comprising: writingsequential host data to a plurality of mixed mode blocks of a memory ina single level cell (SLC) mode; performing a foreground garbagecollection operation in response to: a quantity of blocks of theplurality of mixed mode blocks that are capable of being written toreaching a threshold quantity; and receiving an amount of data to bewritten to a plurality of mixed mode blocks of a memory; whereinperforming the garbage collection operation on at least one of theplurality of mixed mode blocks includes: determining that the at leastone of the plurality of mixed mode blocks storing single level cell(SLC) mode data is to be converted to multi level cell (MLC) mode data;folding data stored in the at least one block of the plurality of mixedmode blocks in SLC mode and data stored in a second block of theplurality of mixed mode blocks in SLC mode, wherein folding the data ofthe at least one block and the data of the second block results in thedata of the at least one block and the data of the second block beingstored in the at least one block; and storing a first portion ofsequential host data received from a host in the at least one of theplurality of mixed mode blocks in MLC mode; and storing a second portionof sequential host data received from the host in a third block of theplurality of mixed mode blocks such that the third block does notinclude folded data.
 24. The method of claim 23, wherein the at leastone of the plurality of mixed mode blocks is chosen based on whether theat least one of the plurality of mixed mode blocks is in an SLC mode.25. The method of claim 23, wherein the at least one of the plurality ofmixed mode blocks is chosen based on, in response to a block with ahighest quantity of invalid data being an XLC mode block, determiningwhether a next-most highest invalid data block is an SLC mode block. 26.The method of claim 25, wherein the highest quantity of invalid datablock is chosen in response to the next-most highest invalid data blockbeing in an XLC mode.
 27. The method of claim 25, wherein the next-mosthighest invalid data block is chosen in response to the next-mosthighest invalid data block being an SLC mode block.